﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace Galaxy.Portal.TCP
{
    public class TempFileStream : FileStream, IDisposable
    {
        public TempFileStream() : base(Path.GetTempFileName(), FileMode.CreateNew, FileAccess.ReadWrite) { }

        #region IDisposable Members

        public new void Dispose()
        {
            string lv_FileName = base.Name;
            base.Dispose();
            File.Delete(lv_FileName);
        }

        void IDisposable.Dispose()
        {
            this.Dispose();   
        }

        #endregion
    }
}
